﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.LogicalGroups.CUiLGRFlattenGroupHierarchyCmd
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using System.Collections;
using Tecnomatix.Engineering;
using Tecnomatix.Engineering.DataTypes;


namespace DnProcessSimulateCommands.LogicalGroups;

public sealed class CUiLGRFlattenGroupHierarchyCmd : TxButtonCommand
{
  private CApLGRLogicalGroupOperationsEnabler m_groupOpEnabler;

  public CUiLGRFlattenGroupHierarchyCmd()
  {
    this.m_groupOpEnabler = new CApLGRLogicalGroupOperationsEnabler();
  }

  public virtual void Execute(object cmdParams)
  {
    ArrayList informationEntries = TxApplication.ActiveSelection.GetAllItemsInformationEntries();
    if (informationEntries.Count != 1)
      return;
    new CApLGREditGroupsManager().Flatten(informationEntries[0] as TxSelectionInformationEntry);
  }

  public virtual string Name => LGRLogicalGroupResource.FLATTEN_HIERARCHY_NAME;

  public virtual string Category => LGRLogicalGroupResource.LOGICAL_GROUP_CATEGORY;

  public virtual string Description => LGRLogicalGroupResource.FLATTEN_HIERARCHY_DESCRIPTION;

  public virtual string Tooltip => LGRLogicalGroupResource.FLATTEN_HIERARCY_TOOLTIP;

  public virtual ITxCommandEnabler CommandEnabler => (ITxCommandEnabler) this.m_groupOpEnabler;

  public virtual string Bitmap => "LogicalGroups.Resources.FlattenGroup.bmp";

  public virtual bool Licensed => TxCommandLicenser.LogicalGroupsLicense;
}
